home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3dm / midi / mdClosePort.z / mdClosePort
Encoding:
Text File  |  1998-10-20  |  6.5 KB  |  133 lines

  1.  
  2.  
  3.  
  4. mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt((((3333ddddmmmm))))                                            mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      mdOpenInPort, mdOpenOutPort, mdClosePort, mdGetFd - open and close
  10.      MDports
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////mmmmiiiiddddiiii....hhhh>>>>
  14.  
  15.      MMMMDDDDppppoooorrrrtttt mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt((((cccchhhhaaaarrrr ****nnnnaaaammmmeeee))))
  16.      MMMMDDDDppppoooorrrrtttt mmmmddddOOOOppppeeeennnnOOOOuuuuttttPPPPoooorrrrtttt((((cccchhhhaaaarrrr ****nnnnaaaammmmeeee))))
  17.      iiiinnnntttt mmmmddddCCCClllloooosssseeeePPPPoooorrrrtttt((((MMMMDDDDppppoooorrrrtttt ppppoooorrrrtttt))))
  18.      iiiinnnntttt mmmmddddGGGGeeeettttFFFFdddd((((MMMMDDDDppppoooorrrrtttt ppppoooorrrrtttt))))
  19.  
  20. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.      mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt and mmmmddddOOOOppppeeeennnnOOOOuuuuttttPPPPoooorrrrtttt create an MDport for a specified
  22.      interface.  An MDport maintains the state of the communications path
  23.      between the application and a MIDI interface.  An MDport is passed as the
  24.      first argument to most MIDI library routines.
  25.  
  26.      The _n_a_m_e parameter contains the name of the MIDI interface to which the
  27.      newly opened port is connected.  The mmmmddddGGGGeeeettttNNNNaaaammmmeeee((((3333ddddmmmm)))) function returns
  28.      strings which can be used as valid values of _n_a_m_e.  If NULL is passed in
  29.      for name, the default MIDI interface will be opened.
  30.  
  31.      When a port is first opened, its default stamp mode is MD_DELTASTAMP and
  32.      the origin of the port is set to the time at which it was opened (see
  33.      mmmmddddSSSSeeeettttSSSSttttaaaarrrrttttPPPPooooiiiinnnntttt((((3333ddddmmmm))))).  If the application changes the stamp mode to one
  34.      of the tick modes (either MD_RELATIVETICK or MD_DELTATICK), the port will
  35.      use a default tempo of 500000 and a default division of 384.  However, an
  36.      application should explicitly set any port parameters it depends on
  37.      rather than depending on the default values.
  38.  
  39.      mmmmddddCCCClllloooosssseeeePPPPoooorrrrtttt closes the connection to the MIDI interface and frees all
  40.      resources associated with the connection.  When a port is closed, all
  41.      events that have been queued but not yet transmitted are discarded.  As a
  42.      result, the application may need to insure that all desired events have
  43.      been transmitted before closing the port.  One way the application can do
  44.      this is for it to wait until mmmmddddTTTTeeeellllllllNNNNoooowwww((((3333ddddmmmm)))) returns the stamp of the last
  45.      transmitted event.
  46.  
  47.      The application must call mmmmddddIIIInnnniiiitttt((((3333ddddmmmm)))) before calling either mdOpenInPort
  48.      or mdOpenOutPort.  Failing to do so will produce indeterminant results.
  49.  
  50.      mmmmddddGGGGeeeettttFFFFdddd returns a file descriptor that an application can use to
  51.      construct the arguments for a sssseeeelllleeeecccctttt((((2222)))) or ppppoooollllllll((((2222)))) call.  These calls are
  52.      used when the application wants to give up control of the CPU (letting
  53.      other processes use the CPU) until a port becomes ready for input or
  54.      output.  MIDI input ports are considered to be ready when one or more
  55.      events are available for reception.  Output ports are ready when they are
  56.      capable of accepting additional events.  Once a port becomes ready,
  57.      select and poll return, and the application can continue processing.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt((((3333ddddmmmm))))                                            mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.      When using select, an input port's file descriptor is used in a read
  75.      fdset and an output port's file descriptor is used in a write fdset.
  76.  
  77.      When using poll, an input port's file descriptor is used with the POLLIN
  78.      event flag and an output port's file descriptor is used with a POLLOUT
  79.      event flag.
  80.  
  81.      mdGetFd should only be used in select or poll; the results of passing it
  82.      as an argument to any other system calls are undefined.
  83.  
  84. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  85.      mdOpenInPort and mdOpenOutPort return an MDport on success or NULL in
  86.      event of failure.  mdClosePort returns 0 on success and -1 on failure.
  87.      On an error, errno will be set to one of the following:
  88.  
  89.      ENOMEM   - No memory was available for the MDport data structure
  90.  
  91.      ENODEV   - The MIDI driver wasn't present
  92.  
  93.      EINVAL   - An undefined operation was called.
  94.  
  95.      mdGetFd returns a file descriptor.  On an error it returns -1.
  96.  
  97. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  98.      mmmmddddIIIInnnnttttrrrroooo((((3333ddddmmmm)))), mmmmddddSSSSeeeettttSSSSttttaaaammmmppppMMMMooooddddeeee((((3333ddddmmmm)))), mmmmddddGGGGeeeettttNNNNaaaammmmeeee((((3333ddddmmmm)))), mmmmddddTTTTeeeellllllllNNNNoooowwww((((3333ddddmmmm)))),
  99.      mmmmddddSSSSeeeettttSSSSttttaaaarrrrttttPPPPooooiiiinnnntttt
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.